package com.lh.service.impl;

import com.lh.service.AsyncService;
import com.lh.util.SendEmail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Author LuoHang
 * @Date 2022-05-08 22:02
 **/
@Service
public class AsyncServiceImpl implements AsyncService {
    public static final Logger logger = LoggerFactory.getLogger(AsyncServiceImpl.class);

    @Async
    @Override
    public void sendEmail(String msg) {
        logger.info("AsyncServiceImpl 开始发送邮件......");
        SendEmail.email(msg);
        logger.info("AsyncServiceImpl 邮件发送完毕......");
    }
}
